﻿using Microsoft.SharePoint;

namespace SPSource.Lists
{
    public class ListUtility
    {
        public static bool ListExists(string listName, string webUrl)
        {
            using (SPSite site = new SPSite(webUrl))
            {
                using (SPWeb web = site.OpenWeb())
                {
                    foreach(SPList list in web.Lists)
                    {
                        if (list.Title == listName)
                            return true;
                    }
                    return false;
                }
            }
        }
    }
}
